flutter random int

59

import 'dart:math';
Random random = new Random();
int randomNumber = random.nextInt(100); // from 0 upto 99 included
//random with minimum value of 10

int randomNumber = random.nextInt(90) + 10; // from 10 upto 99 included
import 'dart:math';

main() {
  var rng = new Random();
  for (var i = 0; i < 10; i++) {
    print(rng.nextInt(100));
  }
}

Comments

Submit
0 Comments